home *** CD-ROM | disk | FTP | other *** search
- Path: prodigy.com!usenet
- From: DPMU12A@prodigy.com (Steve Bailey)
- Newsgroups: comp.lang.c
- Subject: File Open Problem - Please provide clues
- Date: 31 Mar 1996 02:22:09 GMT
- Organization: Prodigy Services Company 1-800-PRODIGY
- Distribution: world
- Message-ID: <4jkq8h$1it6@useneta1.news.prodigy.com>
- NNTP-Posting-Host: innugap1-int.news.prodigy.com
- X-Newsreader: Version 1.2
-
-
- Hi I'm having problems with opening files which are named
- after simple numbers:
- 2
- 5, etc.
- The reason for naming them this way is because I'm writing a
- program in C that increments a number, and then attempts to
- open the file that's actually named by that number.
- I get mismatched type errors when using FOPEN:
- int num;
- filepointer = FOPEN(num,"r"); or
- filepointer = FOPEN("num","r");
-
- Is there a way to manipulate an integer: store it in integer
- variables, arrays, etc.., but then use that integer to open
- a file actually named by that integer?..
- I was going to name the files:
- 0.txt, 1.txt, 2.txt,
- and so forth, but this was even trickier with the string
- concatenating, (attached ".txt" to it) etc.. so the files
- are named after numbers simply..
-
- any help appreciated.
- Steve
-
-
-